<?php
require_once dirname(__DIR__)."/login_filter.php";
use app\cls\tom\Response;
use app\cls\tom\SysResource;
use app\cls\tom\Tools;
use app\model\Users;
$uuid=$Auth['uuid'];
//分页
$page = isset($_REQUEST["page"]) ? intval($_REQUEST["page"]) : 1;
$page = $page > 0 ? $page : 1;
$pageSize = 200;
$redis = SysResource::getRedis();
$key=REDIS_PREFIX.$uuid."my_follow";
//实例化数据库
$db = SysResource::getDB(false);
$redis = SysResource::getRedis();
$Users = new Users($db);
$da4=[];
$da5=[];
//1.分页去查询用户的关注列表
$da1=$Users->my_follow_list($page,$pageSize,$uuid);
//查询用户所有的关注和被关注
$uid=sprintf("%d",crc32($uuid));
//2.再去查用户的粉丝
$da2=$Users->is_follow($uuid);
if(!empty($da2)){
    foreach($da2 as $kk=>$vv){
        $da5[]=$vv['my_uuid'];
    }
}
$guanzhu=2;
if(!empty($da1)){
    foreach($da1 as $kkk=>&$vvv){
        if(in_array($vvv['other_uuid'],$da5)){
            $vvv['guanzhu']= 3;
        }else{
            $vvv['guanzhu']=2;
        }
        if(empty($vvv['test_user_autograph'])){
            $vvv['test_user_autograph']="";
        }
    }
}
Response::output(0,"查询成功",$da1);